<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ include file="../common/common.jsp"%>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.record.RecordBean" scope="request" />
<%

%>

<html>
	<head>
		<title> 実績保存</title>
		<link rel="SHORTCUT ICON" href="../common/img/default/sys_icon.ico">

		<link rel='stylesheet' type='text/css' href='../../common/css/common/base.css' >
		<link rel='stylesheet' type='text/css' href='../../common/css/common/common.css'>
		<link rel='stylesheet' type='text/css' href='../../common/css/master/master.css'>

		<script language="javascript" src="../../common/js/base.js"></script>
		<script language="javascript" src="../../common/js/menu/topmenu.js"></script>

		<!-- システムログ -->
		<script src="../../common/js/systemlog.js"></script>

			<style type='text/css'>
				.LinkItem {
					cursor: pointer;
				}
				.delbtn    {  
				    position: absolute;  
				    top: 230px;  
				    left: 200px;
				    width:200px; 
				    height:50px;
				}  
				
			</style>

		<script language="javascript">
		function onInit(){
			httpRequest();
		}
		function folderPathMake(){
				var pathArray = document.getElementById("uploadFile").value.split("\\");
				var path = "";
				for(i=0;i<pathArray.length-1;i++){
					if(i==0){
						path = pathArray[i];
					}else{
						path = path + "/" + pathArray[i];
					}
					
				}
				document.getElementById("folderPath").value = path;
			}
			
			function folderSelect() {
				document.getElementById("uploadFile").click();
			}
			
			function enableDelete(){
				document.getElementById("enableDeleteFlg").value="1";
				document.getElementById("F1").submit();
			}
			function folderPathInput(){
				if(document.getElementById("folderPath").value==""){
					alert("実績書出しフォルダを選択してください");
				}else{
					document.getElementById("F1").submit();
				}
				
			}
		</script>

	</head>

	<body onLoad="onInit()" style="margin: 0px 4px 0px 0px;">
		<form name="F1" id="F1" action="./recode" method="post" class="frmMain">
			<table class="tblMain" width="100%" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td valign="top">
						<table class='main-width-tb'  cellspacing='0' cellpadding='0' border='0'><tr><td></td></tr></table>
						<table class='main-height-tb' cellspacing='0' cellpadding='0' border='0'><tr><td></td></tr></table>

						<!-- Header Menu START -->
						<jsp:include page="jsp/common/headermenu.jsp"></jsp:include>
						<!-- Header Menu END -->

						<!-- ***** [FORM] MAIN-FORM ***** -->
						<div id="lc-out" style="z-index: 0;">
							<div id="lc-in" style="z-index: 0">
								<div style="text-align: center; margin: 20px ; border: solid 1px black; background-color: white ; width: 98%;">
									<table border="0" cellpadding="0" cellspacing="0"  style="width: 98%;">
										<colgroup width=33% ></colgroup>
										<colgroup width=33% ></colgroup>
										<colgroup width=34% ></colgroup>
										<tr style="height: 5px"><td colspan=3>&nbsp;</td></tr>
										<tr><td colspan=3>&nbsp;</td></tr>
										<tr>
											<td colspan=2>実績書出しフォルダ</td>
											<td>
												<% if ("".equals(formBean.getResult()) || formBean.getResult() == "" ) { %>
													<div id="resultMsg1">&nbsp;</div>
												<% }else{ %>
													<% 	String sRet = formBean.getResult();
														String[] vRet = sRet.split(",");
														%>
														<div class="LinkItem" onClick="javaScript:logSubOpen('../systemlog1000/log1000?parentId=<%=vRet[1]%>');">
														<%
														if ( "-1".equals(vRet[0]) == true ) { %>
														<div id="resultMsg1" style='color: #ff0000;'>登録に失敗しました。</div>
													<% }else  if ("-2".equals(vRet[0]) == true ) { %>
														<div id="resultMsg1" style='color: #ff0000;'>データベースの初期化に失敗しました。</div>
													<% }else  if ("2".equals(vRet[0]) == true  ) { %>
														<div id="resultMsg1" style='color: #0000ff;'>DBの最適化が正常に終了しました。</div>
													<% }else  if ("0".equals(vRet[0]) == true  ) { %>
														<div id="resultMsg1" style='color: #0000ff;'>実績書出しフォルダが設定されているフォルダパスと同じでした。</div>
													<% }else{ %>
														<div id="resultMsg1" style='color: #0000ff;'>実績書出しフォルダの変更が正常に終了しました。</div>
													<% } %>
														</div>
													<%}%>
												<div id="resultMsg2" style="display:none">アップロードを行っています。</div>
												<div id="resultMsg3" style="display:none"></div>
											</td>
										</tr>
										<tr>
											<td colspan=3>
												<input type="text"  id="folderPath" name="folderPath" value="<%=formBean.getFolderPath() %>" size="60"  id="folderPath"><input type="button" value="フォルダ選択" onClick="folderSelect();"><br/>
												<input type="button" value="保存" onClick="folderPathInput();">
												<input type="file" style="width: 600px" id="uploadFile" value="" style="visibility:hidden" onchange='folderPathMake()' >
											</td>
										</tr>
										<tr><td colspan=3>&nbsp;</td></tr>
										<tr>
											<td colspan=3>人作業収集システム<br>DB最適化<input class="delbtn" type="button" value="実行" onClick = "enableDelete();"/></td>
										</tr>
										<tr><td colspan=3>&nbsp;</td></tr>
									</table>
								</div>
								<br>

								
							</div><!-- lc-in End -->


							<!-- ログ Start -->
							<div class="log-box">
								<div class="log-out">
									<div class="log-title">ログ</div>
									<div class="log-in">
										<div id="divOutput"></div>
									</div>
								</div>
							</div>
							<!-- ログ End -->
						
						</div><!-- lc-out  -->
					</td>
				</tr>
			</table>
			<input type="hidden" name="enableDeleteFlg" value="0" id = "enableDeleteFlg">
		</form>
	</body>
</html>
